import 'package:flutter/material.dart';
import 'package:flutter_massage/common_lib/extension/ex_widget.dart';
import 'package:flutter_massage/common_lib/index.dart';
import 'package:flutter_massage/pages/model/bean.dart';
import 'package:flutter_massage/pages/technician_album/technician_album_logic.dart';
import 'package:flutter_massage/values/index.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';

class TechnicianAlbumPage extends GetView<TechnicianAlbumLogic> {
  const TechnicianAlbumPage(this.lists, {super.key});

  final List<TechnicianAlbumBean> lists;

  @override
  Widget build(BuildContext context) {
    return BaseScaffold(
      titleStr: '技师相册',
      scaffoldBackgroundColor: AppColors.grayF8,
      child: GetBuilder<TechnicianAlbumLogic>(
        init: TechnicianAlbumLogic(),
        assignId: true,
        builder: (logic) {
          return GridView.builder(
            padding: EdgeInsets.all(12.w),
            gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
              crossAxisCount: 3,
              mainAxisSpacing: 10.w,
              crossAxisSpacing: 4.w,
              childAspectRatio: 0.82, //111*143
            ),
            itemBuilder: (BuildContext context, int index) {
              return Column(
                children: [
                  ImageWidget.url(
                    lists[index].image ?? '',
                    width: 111.w,
                    height: 111.w,
                    radius: 8.w,
                  ),
                  TextWidget.oneLine(
                    text: lists[index].uname ?? '',
                    fontSize: 12,
                    color: AppColors.textLevelOne,
                    fontWeight: FontWeight.bold,
                  ).paddingTop(8.w),
                ],
              );
            },
            itemCount: lists.length,
          );
        },
      ),
    );
  }
}
